home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / topbeta3.zip / TOP.TXT < prev    next >
Text File  |  1996-05-28  |  6KB  |  178 lines

  1.                     TOP 0.3 - Ian.Hargreaves@ibm.net
  2.  
  3. Disclaimer
  4. ==========
  5. THIS IS AN EARLY VERSION! IT IS BEING PROVIDED PRIMARILY FOR EVALUATION 
  6. PURPOSES ONLY. PLEASE DO NOT USE THIS SOFTWARE IN ANY PRODUCTION ENVIRONMENT.
  7. THE AUTHOR CANNOT BE HELD RESPONSIBLE FOR ANY LOSS OR DAMAGE CAUSED BY USING
  8. THIS SOFTWARE. BY READING THIS YOU AGREE TO THE ABOVE TERMS AND CONDITIONS.
  9. IF YOU DO NOT AGREE TO THESE TERMS - PLEASE DESTROY ALL COPIES OF THIS 
  10. SOFTWARE. 
  11.  
  12. THIS SOFTWARE IS PROVIDED AS IS AND COMES WITH NO WARRANTY OF ANY KIND. 
  13.  
  14.  
  15. License
  16. =======
  17. This software is E-MAILWARE. Simply send me an e-mail to Ian.Hargreaves@ibm.net
  18. and you can use this software for as long as you want.
  19.  
  20. The software and all associated files are copyrighted by Ian Hargreaves. You 
  21. may copy this software for backup purposes. You may also copy and share 
  22. unmodified copies of the whole package, providing that the copyright notice
  23. is reproduced and included on all copies.
  24.  
  25.  
  26. Introduction
  27. ============
  28. This utility is similar to the Un*x tool TOP. It displays a list of processes 
  29. and the amount of CPU they are using. The amount of CPU is calculated using 
  30. the undocumented OS/2 call DosQProcStatus. This function gives details for each
  31. thread on how much SYSTEM (kernel time) and how much USER (application) time is
  32. being used.
  33.  
  34. This is NOT a load monitor - the statistics displayed are not real time, they 
  35. are the statistics for the previous monitoring period, which is currently 2 
  36. seconds.
  37.  
  38. The load is calculated by comparing the amount of CPU that a process has used
  39. in the current monitoring period compared to how much the same process used in
  40. the last monitoring period.
  41.  
  42.  
  43. Display
  44. =======
  45. A list of active processes is displayed and sorted according to the current
  46. sort specification.
  47.  
  48. Processes are displayed in colour according to how much CPU they have been
  49. using .... 
  50.  
  51.     0%  - 33% GREEN 
  52.     34% - 66% YELLOW 
  53.     67% - 99% WHITE_ON_RED 
  54.  
  55. Here is some sample output from TOP...
  56.  
  57. Procs:26  Threads:119 Ready:2  Loaded:3  Blocked:113 Time:13:11:52 Up:  3:03:48
  58. Total CPU     CPU% Avg% Pid Thr Pri Name
  59.   0:00:01.209  0.0  0.0   6   1 200 C:\IBMCOM\LANMSGEX.EXE
  60.   0:00:00.155  0.0  0.0   4   1 21F C:\OS2\SYSTEM\LOGDAEM.EXE
  61.   0:10:57.665 30.6>25.2  22  24 200 C:\OS2\PMSHELL.EXE
  62.  
  63. Procs:      Total number of running processes.
  64.  
  65. Threads:    Total number of threads
  66.  
  67. Loaded:     Threads that are loaded but not running or blocked - used to keep
  68.             processes in memory without them actually running
  69.  
  70. BLocked:    Blocked threads - waiting for some event to happen.
  71.  
  72. Time:       Guess.
  73.  
  74. Up:         System up time.
  75.  
  76. Total CPU:  Total amount of SYSTEM and USER time this process has used.
  77.             (HH:MM:SS.MMMM)
  78.  
  79. CPU%:       The percentage of the total CPU usage in the last time period that
  80.             was used by this process
  81.  
  82. Avg%        Average CPU percentage of this process (reset by pressing A)
  83.  
  84. Pid:        Process identification number. Each process is given a unique 
  85.             identification number before it can start execution. This number
  86.             could in theory loop around to start from 0 again.
  87.  
  88. Thr:        The number of threads this process has created.
  89.  
  90. Pri:        Process priority. Processes don't actually have a priority - 
  91.             threads do. This is the figure for the priority of the first thread
  92.             in a process (every process has at least one thread).
  93.  
  94. Name:       Work it out yourself.
  95.  
  96. Please note that the the loaded+blocked+ready threads does not equal total
  97. threads. This is because the number of running threads is not included, and
  98. unless you are lucky enough to have a multi-processor system - you will only
  99. ever see one thread in the RUNNING state.
  100.  
  101.  
  102. Keyboard Options
  103. ================
  104. The following keys may be used once top has started.
  105.  
  106. F1  - Display this help text
  107.  
  108. F3, X, Q, ESC
  109.     - End program
  110.  
  111. S:Sort Options
  112.     U: Sort by percent CPU Usage
  113.     T: Sort by Total CPU Usage
  114.     P: Sort by Process ID
  115.     N: Sort by Process Name
  116.     I: Sort by prIority
  117.     O: nO sort order
  118.  
  119. Process Name
  120.     N: Toggle full path,  or .EXE name only
  121.  
  122. Kill Process
  123.     K: Enter PID Number - This will only kill the top level process 
  124.        NOT the whole process tree.
  125.  
  126. Memory/Process Details
  127.     M: Toggle display of memory, and swap or process summary
  128.  
  129. Average CPU Reset
  130.     A: Resets CPU average to 0, and re-starts average calculation
  131.  
  132. Display Process
  133.     D: Enter PID of process to display
  134.  
  135. Page Up/Down
  136.     Move process list up/down for long lists
  137.  
  138.  
  139. Technical Information
  140. =====================
  141. TOP uses only 2 threads - one to process keyboard options, and another one to 
  142. call DosQProcStatus, calculate usage, and display the results.
  143.  
  144. Both threads run at the default priority class and in total will not impact 
  145. system performance by any significant amount.
  146.  
  147. TOP is a VIO mode program. This means that if you increase the number if lines
  148. that are available at the command prompt, TOP will use those extra lines to 
  149. display more information.
  150.  
  151. So, it might be a good idea to run choose a smaller font, and set the number of
  152. lines to 50 .. [C:\]MODE CO80,50
  153.  
  154. By the way - remember this is NOT a load monitor. Most load monitors work by 
  155. having a background thread run constantly to calculate CPU usage.
  156.  
  157. TOP spends most of it's time sleeping between screen updates during which time
  158. the CPU is free to do other more useful stuff.
  159.  
  160.  
  161. Known Bugs
  162. ==========
  163.  
  164. Very large numbers appear sporadically in CPU usage column under heavy system
  165. load.
  166.  
  167. Sometimes CPU usage is 0 for all processes or 50% for just one process.
  168.  
  169. Contacting the author
  170. =====================
  171. Please feel free to provide any feedback - positive or negative, and/or
  172. enhancement requests to the author at the following addresses.
  173.  
  174. E-Mail:     Ian.Hargreaves@ibm.net  (preferred)
  175. Compuserve: 100432,2162
  176.  
  177. ------------------------------------EOF----------------------------------------
  178.